package com.bdqn.service;

import com.bdqn.mapper.StudentInfoMapper;
import com.bdqn.pojo.StudentInfo;

import javax.annotation.Resource;
import java.util.List;

public class StudentInfoServiceImpl implements StudentInfoService{
    @Resource
    private StudentInfoMapper studentInfoMapper;

    /**
     * 获得所有学生信息数据
     *
     * @return
     */
    @Override
    public List<StudentInfo> getList() {
        return studentInfoMapper.getList();
    }

    /**
     * 根据ID获得学生信息
     *
     * @param sid
     * @return
     */
    @Override
    public StudentInfo getById(Long sid) {
        return studentInfoMapper.getById(sid);
    }

    /**
     * 根据ID修改学生信息
     *
     * @param studentInfo
     * @return
     */
    @Override
    public int update(StudentInfo studentInfo) {
        return studentInfoMapper.update(studentInfo);
    }

    /**
     * 根据ID删除学生信息
     *
     * @param sid
     * @return
     */
    @Override
    public int delete(Long sid) {
        return studentInfoMapper.delete(sid);
    }

    /**
     * 添加学生信息
     *
     * @param studentInfo
     * @return
     */
    @Override
    public int add(StudentInfo studentInfo) {
        return studentInfoMapper.add(studentInfo);
    }
}
